<?php
use Yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
$this->title = '数据统计';
?>
<div class="container">
    <div class="row">
      
        <?php echo $this->render('_leftnav'); ?>
        <div class="col-md-10">
          <div class="page-header clearfix">
            <h1 class="pull-left">数据统计</h1>
            <div class="pull-right">                                            
            </div>
          </div>          
            <link href="/css/morris.css" rel="stylesheet">
<div class="row">
  <div class="col-md-12">
    <div class="col-md-12">
  <?php
	$form = ActiveForm::begin([
	'action' => ['operate/searchinfo'],
	'method'=>'post',
	'options' => [
					'id' => 'operation-form',
	                'class' => 'well well-sm form-inline'
				 ]
		]);	
	?>  
  <div class="form-group in-focus">
  <?= Html::dropDownList('list','', ArrayHelper::map([
      'nulls'=>'--选择数据类型--',
      'newuser'=>'新注册用户数',      
      'newcourse'=>'新增课程数',
      'newchapter'=>'新增课程-章数',
      'newsection'=>'新增课程-节数',
      'newclasshour'=>'新增课-时数',
      'learning'=>'加入学习数',
      'paycourse'=>'购买课程数',
      'completeour'=>'完成课时学习数',
      'video'=>'视频观看数',
      /*'nulls1'=>'└─ 云视频观看数',
      'nulls2'=>'└─ 本地视频观看数',
      'nulls3'=>'└─ 网络视频观看数',
      'nulls4'=>'营收额',
      'nulls5'=>'└─ 课程营收额',
      'nulls6'=>'└─ 课程总数',
      'nulls7'=>'└─ 用户总数',*/
  ], 'id', 'name'),['class' => 'form-control']) ?>
  </div>
        <div class="form-group">
         <?= Html::button('本月', ['class' => 'btn btn-default active','id'=>'nowmon','data-type'=>'day','begintime'=>strtotime(date('Y-m-01',time())),'endtime'=>time()]) ?>
        </div>
        <div class="form-group">
         <?= Html::button('上月', ['class' => 'btn btn-default','id'=>'lastmon','data-type'=>'day','begintime'=>strtotime(date('Y-m-01',strtotime('-1 month'))),'endtime'=>strtotime(date('Y-m-t', strtotime('-1 month')))]) ?>
        </div>      

        <div class="form-group mll">
          <label class="ptm">年份</label>
          <?php for($i=2000;$i<2030;$i++){
              $arryears[$i] = $i.'年';
          }
            $arryears['nulls'] = '年份';
          for($j=1;$j<=12;$j++){
              $j = $j<10?'0'.$j:$j;
             $arrmon[$j] = $j.'月';
          } 
            $arrmon['nulls'] = '月份';    
          ?>
            <?= Html::dropDownList('years','nulls', ArrayHelper::map($arryears, 'id', 'name'),['class' => 'form-control']) ?>
        </div>
        <div class="form-group mll">
          <label class="ptm">起始</label>
            <?= Html::dropDownList('starttime','nulls', ArrayHelper::map($arrmon, 'id', 'name'),['class' => 'form-control']) ?>
        </div>

        <div class="form-group mls">
          <label class="ptm">截止</label>
          <?= Html::dropDownList('endtime','nulls', ArrayHelper::map($arrmon, 'id', 'name'),['class' => 'form-control']) ?>
        </div>
            <?= Html::button('查询', ['class' => 'btn btn-primary pull-right','id'=>'sub','data-type'=>'month','style'=>'margin-right:50px']) ?>  
  <?php ActiveForm::end(); ?>	
        </div>
        
  <div class="col-md-12"><br>
  </div>
  <!-- <div class="col-md-12">
      <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active">
            <a href="http://dcoffee.edusoho.com.cn/admin/operation/analysis/register/trend?startTime=2015-11-01&amp;endTime=2015-11-17&amp;analysisDateType=register">
            趋势</a>
        </li>
        <li role="presentation">
            <a href="http://dcoffee.edusoho.com.cn/admin/operation/analysis/register/detail?startTime=2015-11-01&amp;endTime=2015-11-17&amp;analysisDateType=register">明细</a>
       </li>
      </ul>
     </div> -->
  <div style='text-align:center;'>
    <h3><span id='imgtitle'></span><span>统计图</span></h3>
  </div>   
  <?= Html::cssFile('./assets/css/dhtmlxchart.css')?>
  <?= Html::jsFile('./assets/js/dhtmlxchart.js')?>
  <?= Html::jsFile('./assets/js/testdata.js')?>
  <div id="chart" style="width:1000px;height:250px;border:1px solid #A4BED4;margin-left:1%;"></div> 
</div>
</div>
 </div>
</div>
</div>